using MauiBuilder.ViewModels;

namespace MauiBuilder.Views
{
    /// <summary>
    /// 日志查看页面
    /// </summary>
    public partial class LogPage : ContentPage
    {
        private readonly LogPageViewModel _viewModel;

        public LogPage(LogPageViewModel viewModel)
        {
            InitializeComponent();
            BindingContext = _viewModel = viewModel;
        }

        /// <summary>
        /// 页面显示时的处理
        /// </summary>
        protected override void OnAppearing()
        {
            base.OnAppearing();
            // 页面显示时刷新日志文件列表
            _viewModel.LoadLogFilesCommand.Execute(null);
        }
    }
}